<CFMODULE TEMPLATE = "#CLIENT.COMMON_PATH#cfm_wswindow.cfm" TITLE = "New Manning Form">
<cfquery datasource="#client.company_dsn#" name="getDept">
	SELECT DEPARTMENTCODE, DESCRIPTION 
    FROM CLKDEPARTMENT
</cfquery>

  
<cfquery datasource="#client.company_dsn#" name="getAllEmployees">
	<cfif uCase(client.DBMS) eq 'MSSQL'>
		SELECT '('+PERSONNELIDNO+')'+LASTNAME+', '+FIRSTNAME+ +MIDDLENAME as GUID,
   			'('+PERSONNELIDNO+'~'+GUID+')' as ID
	
    <cfelse>
    	SELECT concat( "(",PERSONNELIDNO,") ",LASTNAME,", ",FIRSTNAME," ",MIDDLENAME) as GUID,
   			CONCAT(PERSONNELIDNO,"~",GUID) as ID
    </cfif>
    FROM CMFPA
    ORDER BY LASTNAME, FIRSTNAME,MIDDLENAME
</cfquery>

<CFQUERY DATASOURCE="#client.global_dsn#" NAME="autogen">
    SELECT SEEDKEY,CODELENGTH,FIELDNAME,TABLENAME,WITHDATE
    FROM GSTAUTOGENFIELD
    WHERE TABLENAME = 'CINWSFILE' AND
          FIELDNAME = 'DOCNUMBER'
</CFQUERY>
<CFMODULE TEMPLATE="#client.common_path#autogenfield.cfm"
    SEEDKEY="#autogen.SEEDKEY#"
    CODELENGTH="#autogen.CODELENGTH#"
    COLUMNNAME="#autogen.FIELDNAME#"
    TABLENAME_FK="#autogen.TABLENAME#"
    DATASOURCE="#client.company_dsn#"
    WITHDATE="#autogen.WITHDATE#">
<CFSET sValue=AUTOGENVALUE>
	
<CFFORM NAME = "frmPMFFile" action="_save.cfm" method="post">   
	<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 2 WIDTH = "100%" BGCOLOR = "#FFFFFF"> 
    	<tr>
			<cfif isDefined("client.err")>
        		<td colspan="6"><p id="err"><cfoutput>#client.err#</cfoutput></p></td>
            </cfif>
        </tr>
		<TR>
			<TD COLSPAN = 6>
				<CFINPUT CLASS = "BITBTN" TYPE = "SUBMIT" NAME = "SSAVEpmfFILE" VALUE= "Save" onClick="javascript: autoSelectAll(); "/>
				<CFINPUT CLASS = "BITBTN" TYPE = "BUTTON" NAME = "SBACKPYFILE" VALUE= "Back" clicked = 0 onclick = "javascript:history.back()"/>
			<HR>
			</TD>
		</TR>
		<TR>
			<TD COLSPAN = 6>
            <CFMODULE TEMPLATE = "#CLIENT.COMMON_PATH#cfm_group.cfm" CAPTION = "Manning Request File">
            </TD>
		</TR>


		<TR>
			<TD width="123" ALIGN="RIGHT" NOWRAP>Document Number :</TD>
			<TD WIDTH = 16>&nbsp;*&nbsp;</TD>
			<TD COLSPAN="4"><CFINPUT TYPE="text" NAME="DocNum" SIZE = 50 MAXLENGTH = 20 VALUE="#sValue#" READONLY></TD>
		</TR>					
		<TR>
			<TD NOWRAP ALIGN="RIGHT">File Name :</TD>
			<TD WIDTH = 16>&nbsp;*&nbsp;</TD>
			<TD COLSPAN="4">
            	<CFINPUT TYPE = "TEXT" NAME = "FILENAME" MAXLENGTH = 50 SIZE = 50 required 
                message="File name must not be empty.">
           	</TD>
		</TR>
        <TR>
			<TD NOWRAP ALIGN="RIGHT">Period From :</TD>
			<TD WIDTH = "16">&nbsp;*&nbsp;</TD>
			<TD WIDTH = "901">
            	<CFINPUT TYPE = "DATEFIELD" NAME = "FROM" 
                message="Assesment date 'FROM',must not be empty" mask="MMMM DD, YYYY" required="yes" 
                READONLY>
            </TD>
       </TR>
       <TR>
			<TD NOWRAP ALIGN="RIGHT">Period To :</TD>
			<TD WIDTH = "16">&nbsp;*&nbsp;</TD>
			<TD width="901">
            	<CFINPUT TYPE = "DATEFIELD" NAME = "TO" mask="MMMM DD, YYYY"  
                message="Assesment date 'TO', must not be empty" required="yes" 
                READONLY>
            </TD>
		</TR>
         <TR>
			<TD NOWRAP ALIGN="RIGHT">Department :</TD>
			<TD WIDTH = "16">&nbsp;*&nbsp;</TD>
			<TD colspan="3">
            	<cfselect name="deptcode" query="getDept" display="DESCRIPTION" value="DEPARTMENTCODE" 
                onChange="clearFields();"/>
            </TD>
		</TR>
        <TR>
			<TD NOWRAP ALIGN="RIGHT">Remarks :</TD>
			<TD WIDTH = "16">&nbsp;*&nbsp;</TD>
			<TD colspan="3">
            	<cftextarea name="remarks" required cols="30%" maxlength="100"></cftextarea>
            </TD>
		</TR>
		<TR>
			<TD COLSPAN = 6>
            <CFMODULE TEMPLATE = "#CLIENT.COMMON_PATH#cfm_group.cfm" CAPTION = "Choose Employee(s) to be assigned">
            </TD>
		</TR>
		<TR>
			<TABLE BORDER = 0 CELLPADDING = 2 CELLSPACING = 2 WIDTH = "100%" BGCOLOR = "#FFFFFF">
				<TR>
					<TD WIDTH = "40%">
							<CFSELECT id="available" NAME = "SSELAVAIALABLEMPLOYEES" SIZE = 20 
                            MULTIPLE STYLE = "WIDTH: 100%" 
                            VALUE = "ID" DISPLAY = "GUID" BINDONLOAD = "TRUE" 
                            ondblclick = "javascript: Select_Employee()" 
                            bind="cfc:eworksched.cfc.component.getByDept({deptcode})">
							</CFSELECT>
					</TD>
					<TD WIDTH = "20%" ALIGN = "CENTER" NOWRAP>
							&nbsp;&nbsp;&nbsp;<INPUT TYPE = "BUTTON" VALUE = "Include" STYLE = "HEIGHT: 20PX; WIDTH: 100PX" CLASS = "BITBTN" onclick = "javascript: Select_Employee()">&nbsp;&nbsp;&nbsp;<BR><BR>
							&nbsp;&nbsp;&nbsp;<INPUT TYPE = "BUTTON" VALUE = "Exclude" STYLE = "HEIGHT: 20PX; WIDTH: 100PX" CLASS = "BITBTN" onclick = "javascript: Remove_Employee()">&nbsp;&nbsp;&nbsp;<BR><BR>
							&nbsp;&nbsp;&nbsp;<INPUT TYPE = "BUTTON" VALUE = "Include All" STYLE = "HEIGHT: 20PX; WIDTH: 100PX" CLASS = "BITBTN" onclick = "javascript: Select_All_Employee()">&nbsp;&nbsp;&nbsp;<BR><BR>
							&nbsp;&nbsp;&nbsp;<INPUT TYPE = "BUTTON" VALUE = "Exclude All" STYLE = "HEIGHT: 20PX; WIDTH: 100PX" CLASS = "BITBTN" onclick = "javascript: Remove_All_Employee()">&nbsp;&nbsp;&nbsp;
					</TD>
					<TD WIDTH = "40%">
						<CFSELECT NAME = "SSELSELECTEDEMPLOYEES" SIZE = 20 MULTIPLE STYLE = "WIDTH: 100%" ondblclick = "javascript: Remove_Employee()" required="yes" message="Rateer Required.">
						</CFSELECT>
					</TD>
				</TR>
			</TABLE>
		</TR>
	</TABLE>
</CFFORM>
<cfajaxproxy bind="javascript:compDate({frmPMFFile.TO},{frmPMFFile.FROM})"> 
<HR>
<I>* - Field that requires a value.</I> 
<CFMODULE TEMPLATE = "#CLIENT.COMMON_PATH#cfm_wswindow.cfm" TOP = "FALSE">
 
 	
<script>
	window.onload = onShow();
</script>
